'use client';

import React from 'react';
import { ThemeToggle } from '@/components/ThemeToggle';
import TestTools from './TestTools';

const MainLayout = ({ children }: { children: React.ReactNode }) => {
  const isDev = process.env.NODE_ENV === 'development';

  return (
    <div className="h-screen flex flex-col bg-white dark:bg-stone-900">
      <header className="flex-shrink-0 h-14 flex items-center justify-between pl-20 pr-4 border-b dark:bg-stone-900 dark:border-stone-800">
        <div className="flex-grow h-full" style={{ webkitAppRegion: 'drag' }}></div>
        <ThemeToggle />
      </header>

      <div className="flex flex-grow overflow-hidden">
        {children}
      </div>
      {/* 浮动测试工具栏 */}
      {isDev && <TestTools />}
    </div>
  );
};

export default MainLayout; 